package cn.stylefeng.guns.modular.shuheng.mapper;

import cn.stylefeng.guns.modular.shuheng.entity.Content;
import cn.stylefeng.guns.modular.shuheng.entity.Data;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;


/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author zhengpp
 * @since 2021-03-07
 */
public interface DataMapper extends BaseMapper<Data> {
    Page<Map<String, Object>> selectData(@Param("page") Page page, @Param("condition") String condition,@Param("parentId") Long parentId,@Param("year") Integer year,@Param("regionType")Integer regionType,@Param("province") Long province,@Param("city") Long city,@Param("county") Long county);

    List<Data> listByContentId(@Param("contentId") Long contentId, @Param("regionType") String regionType);

    List<Map<String,Object>> listByYearMonth(@Param("year") Integer year,@Param("regionType")Integer regionType,@Param("dataMonth")Integer dataMonth,@Param("province") Long province,@Param("city") Long city,@Param("county") Long county);

    List<Map<String, Object>> countByLevelId(@Param("year") Integer year,@Param("regionType")Integer regionType,@Param("dataMonth")Integer dataMonth,@Param("province") Long province,@Param("city") Long city,@Param("county") Long county);

    List<Map<String, Object>> countByContentId(@Param("year") Integer year,@Param("regionType")Integer regionType,@Param("dataMonth")Integer dataMonth,@Param("province") Long province,@Param("city") Long city,@Param("county") Long county);

    List<Data> listByLevelId(@Param("levelId")String levelId, @Param("regionType")String regionType);

    Page<Map<String, Object>> listCityRank(@Param("page") Page page,@Param("year")Integer year, @Param("rankType")Integer rankType,@Param("quarterArr") String[] quarterArr);
    List<Map<String, Object>> excelCityRank(@Param("year")Integer year, @Param("rankType")Integer rankType,@Param("quarterArr") String[] quarterArr);

    Page<Map<String, Object>> listCountyRank(@Param("page") Page page,@Param("userLevel") Integer userLevel,@Param("year")Integer year, @Param("city")Long city, @Param("rankType")Integer rankType,@Param("quarterArr") String[] quarterArr);
    List<Map<String, Object>> excelCountyRank(@Param("userLevel") Integer userLevel,@Param("year")Integer year, @Param("city")Long city, @Param("rankType")Integer rankType,@Param("quarterArr") String[] quarterArr);

    Page<Map<String, Object>> listCityCompletion(@Param("page") Page page,@Param("year")Integer year, @Param("rankType")Integer rankType,@Param("quarterArr") String[] quarterArr);

    Page<Map<String, Object>> listCountyCompletion(@Param("page") Page page,@Param("userLevel") Integer userLevel,@Param("year")Integer year, @Param("city")Long city, @Param("rankType")Integer rankType,@Param("quarterArr") String[] quarterArr);

    List<Map<String,Object>> excelCityCompletion(@Param("year")Integer year, @Param("rankType")Integer rankType,@Param("quarterArr") String[] quarterArr);

    List<Map<String,Object>> excelCountyCompletion(@Param("userLevel") Integer userLevel,@Param("year")Integer year, @Param("city")Long city, @Param("rankType")Integer rankType,@Param("quarterArr") String[] quarterArr);

    List<Map<String,Object>> listCityCompletionData(@Param("year") Integer year,@Param("quarterArr") String[] quarterArr);

    List<Map<String,Object>> listCountyCompletionData(@Param("year")Integer year,@Param("quarterArr") String[] quarterArr,@Param("userLevel") Integer userLevel,@Param("city") Long city);

    List<Map<String,Object>> listCityRankData(@Param("year")Integer year,@Param("quarterArr") String[] quarterArr);

    List<Map<String,Object>> listCountyRankData(@Param("year")Integer year,@Param("quarterArr") String[] quarterArr,@Param("userLevel") Integer userLevel,@Param("city") Long city);

    List<Map<String,Object>> listCompletionByCity(@Param("year")Integer year,@Param("quarterArr") String[] quarterArr);
    List<Map<String,Object>> listCompletionByCounty(@Param("year")Integer year,@Param("quarterArr") String[] quarterArr,@Param("userLevel")Integer userLevel,@Param("city") Long city);

    List<Map<String, Object>> mapByCity(@Param("year")Integer year,@Param("quarterArr") String[] quarterArr, @Param("regionId") Long regionId);
    List<Map<String, Object>> mapByCounty(@Param("year")Integer year,@Param("quarterArr") String[] quarterArr, @Param("regionId") Long regionId);

    Page<Map<String,Object>> listCityProblem(@Param("page")Page page,@Param("year")Integer year,@Param("rankType") Integer rankType,@Param("quarterArr") String[] quarterArr);

    Page<Map<String,Object>> listCountyProblem(@Param("page")Page page,@Param("userLevel") Integer userLevel, @Param("year") Integer year, @Param("city") Long city,@Param("rankType") Integer rankType,@Param("quarterArr") String[] quarterArr);

    List<Map<String,Object>> listExcelCityProblem(@Param("year")Integer year,@Param("rankType") Integer rankType,@Param("quarterArr") String[] quarterArr);

    List<Map<String,Object>> listExcelCountyProblem(@Param("userLevel") Integer userLevel, @Param("year") Integer year, @Param("city") Long city,@Param("rankType") Integer rankType,@Param("quarterArr") String[] quarterArr);

    Page<Map<String,Object>> listCityProblemSearch(@Param("page")Page page,@Param("year")Integer year, @Param("problemType")Integer problemType, @Param("dataId")Long dataId,@Param("dataName") String dataName,@Param("quarterArr") String[] quarterArr);

    Page<Map<String,Object>> listCountyProblemSearch(@Param("page")Page page, @Param("userLevel")Integer userLevel, @Param("year")Integer year, @Param("city")Long city, @Param("problemType")Integer problemType, @Param("dataId")Long dataId,@Param("dataName") String dataName,@Param("quarterArr") String[] quarterArr);

    Data findDataByFileId(@Param("fileId") Long fileId);

    List<Map<String,Object>> listByYearBeforeMonth(@Param("year") Integer year,@Param("regionType")Integer regionType,@Param("dataMonth")Integer dataMonth,@Param("province") Long province,@Param("city") Long city,@Param("county") Long county);

}
